import storageApi from '../../../core/storage/storage';
/*eslint-disable */
function engineerAdviceController($rootScope, $scope) {
  'ngInject';

  $scope.$watch('$engineerAdviceCtrl.ngModel', (newValue) => {
    this.data = newValue;
    if (this.data && this.data.createnodeTime) {
      this.data.time = this.handleTime(this.data.createnodeTime);
    }
  });

  this.handleTime = (time) => {
    if (time) {
      return (new Date(Date.parse(time.replace(/-/g, '/'))).getTime());
    }
    return null;
  }
}

export default engineerAdviceController;
